package demo3;

class Person implements Cloneable{
    public String name;
    public int age;

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}

public class Test {
    public static void main(String[] args) throws CloneNotSupportedException {
        Person person1 = new Person();
        person1.age = 12;
        person1.name = "frost";
        Person person2 = (Person)person1.clone();
        System.out.println(person2);

        String s1 = "abc";
        String s2 = "abc";
        System.out.println(s1.equals(s2));
    }
}
